<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <h1>{{msg}}</h1>
    </div>

    <h1>{{msg}}</h1>
</body>

<script type="text/javascript">
    // 实例化vue对象
    let vm = new Vue({
        el: "#app",
        data: {// 在data当中声明的属性为全局属性，可以在其他地方通过this.属性名进行访问
            msg: "大锤"
        },
        json: {
            msg: "小锤"
        },
        methods: {
            a(){
                console.log(this.msg);
            }
        },
        template: {

        }
    });

    /**
     * private String name;
     * public User(String name){
     *     this.name = name;
     * }
     */
</script>
</html>